<!--
 * @Description: 
 * @version: 
 * @Author: liurui
 * @Date: 2024-02-05 14:58:34
 * @LastEditors: 
 * @LastEditTime: 2024-02-05 15:09:47
-->
<template>
    <div>

    </div>
</template>

<script setup lang="ts">
// 实现一个接收 string,number 或 bigInt 类型参数的Absolute类型,
// 返回一个正数字符串

type Test = -100;
type Result = Absolute<Test>; // expected to be "100"

type Absolute<T extends number | string | bigint> =
    `${T}` extends `-${infer S}` ? `${S}` : `${T}`;

</script>

<style scoped>

</style>